#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#define debug(a) cout<<#a<<"="<<a<<endl;
using namespace std;
const int maxn=60;
typedef long long LL;
const LL mod=1e9+7;
inline LL read(){LL x=0,f=1;char ch=getchar();	while (!isdigit(ch)){if (ch=='-') f=-1;ch=getchar();}while (isdigit(ch)){x=x*10+ch-48;ch=getchar();}
return x*f;}
LL dp[maxn][maxn];
char str[maxn];
LL add(LL l,LL r){
    LL sum=0;
    for(LL i=l;i<=r;i++){
        sum=(sum*10%mod+(str[i]-'0')%mod)%mod;
    }
    return sum;
}
int main(void)
{
  cin.tie(0);std::ios::sync_with_stdio(false);
  cin>>(str+1);
  LL len=strlen(str+1);

  for(LL i=1;i<=len;i++){
     for(LL j=1;j<=i;j++){
        if(j==i){
            dp[i][j]=(dp[i][j]%mod+add(1,i)%mod)%mod;
        }
        for(LL k=1;k<=(i-j);k++){
            dp[i][j]=(dp[i][j]%mod+dp[i-j][k]%mod+add(i-j+1,i)%mod)%mod;
        }
     }
  }
  LL ans=0;
  for(LL j=1;j<=len;j++){
    ans=(ans%mod+dp[len][j]%mod)%mod;
  }
  cout<<ans<<"\n";
return 0;
}
